<template>
  <div>
    <div id="cc"></div>
  </div>
</template>

<script>
import Obj from "./Obj.js";
export default {
  name: "fourth",
  mounted() {
    var myObj = new Obj({
      el: "cc",
      data: 123,
      fn(val) {
        console.log(val);
      },
    });
  },
  methods: {
    fun() {
      Array.prototype.sum = function() {
        var sum = 0;
        for (let index = 0; index < this.length; index++) {
          sum += this[index];
        }
        return sum;
      };
      var arr = [100, 2, 33, 44, 5];
      // console.log(arr.sum());
      // console.log(arr.__proto__);

      function Fathre(name) {
        this.name = name;
      }
      function Son(name) {
        Fathre.call(this, name);
      }
      var son = new Son("张三");
      // console.log(son);
    },
  },
};
</script>
<style lang="scss" scoped></style>
